﻿@using Orchard.ContentManagement

@{
    var userCanRegister = WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().UsersCanRegister;
    var enableLostPassword = WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().EnableLostPassword;
}

<h1 class="page-title">@Html.TitleForPage((string)Model.Title)</h1>
<p>
    @T("Please enter your username and password.")
    @if (userCanRegister) { @Html.ActionLink(T("Register").Text, "Register") @T(" if you don't have an account.") }
    @if (enableLostPassword) { <text> </text> @Html.ActionLink(T("Lost your Password?").Text, "RequestLostPassword") }
</p>
@Html.ValidationSummary(T("Login was unsuccessful. Please correct the errors and try again.").ToString(), new { @class = "text-error" })

@using (Html.BeginFormAntiForgeryPost(Url.Action("LogOn", new { ReturnUrl = Request.QueryString["ReturnUrl"] }))) {
    <fieldset class="login-form group">
        <legend>@T("Account Information")</legend>
        <ul>
            <li>
                <label for="username-email">@T("Username")</label>
                <div class="input-prepend">
                    <span class="add-on"><i class="icon-user"></i></span>
                    @Html.TextBox("userNameOrEmail", "", new { id = "username-email", autofocus = "autofocus" })
                </div>
                @Html.ValidationMessage("userNameOrEmail", new { @class = "text-error" } )
            </li>
            <li>
                <label for="password">@T("Password")</label>
                <div class="input-prepend">
                    <span class="add-on"><i class="icon-lock"></i></span>
                    @Html.Password("password")
                </div>
                @Html.ValidationMessage("password", new { @class = "text-error" })
            </li>
            <li>
                <label class="checkbox" for="remember-me">
                    @Html.CheckBox("rememberMe", new { id = "remember-me" })@T("Remember Me")
                </label>
            </li>
        </ul>
        <div class="form-actions">
            <button class="btn btn-primary" type="submit">@T("Sign In")</button>
        </div>
    </fieldset>
}